//1185. 一周中的第几天


#include <string>
#include <vector>
using namespace std;

class Solution {
public:
    string dayOfTheWeek(int day, int month, int year) {
        vector<string> week = {"Monday", "Tuesday", "Wednesday", "Thursday", 
        "Friday", "Saturday", "Sunday"};
        vector<int> monthDays = {0,31,28,31,30,31,30,31,31,30,31,30,31};

        int days = (year-1971)*365 + (year-1969)/4;//加上闰年多出的一天，1968是闰年，4年一闰，
                                                   //但必须到第五年才能+1(到第五年才包含了第四年)
        for(int i = 0; i < month; ++i)
        {
            days += monthDays[i];
        }
        if(month > 2
        && ((year%4 == 0 && year%100 != 0) || (year%400 == 0)))
        {
            days++;
        }
        days += day;

        return week[(days+3)%7];
    }
};